{% extends "base.html" %}
{% load render_bundle from webpack_loader %}
{% load project_extras %}

{% block page_title %}Admin{% endblock %}
{% block heading %}Admin - {{object}}{% endblock %}

{% block content %}
<div class="card full">
  <div class="cardface">
    <h2>{{ project.name }}</h2>
    <div class="card-header">
      <ul class="nav nav-tabs card-header-tabs">
        <li class="nav-item active">
          <a data-toggle="tab" href="#label" class="nav-link">Labeled Data</a>
        </li>
        {% if project.classifier != None %}
        <li class="nav-item" id="al_tab">
          <a data-toggle="tab" href="#model" class="nav-link">Active Learning Model</a>
        </li>
        {% endif %}
        {% if project.percentage_irr > 0 %}
        <li class="nav-item" id="irr_tab_navitem">
          <a data-toggle="tab" href="#irr_tab" class="nav-link">IRR</a>
        </li>
        {% endif %}
      </ul>
    </div>
    <div class="tab-content">
      {% include "projects/admin/admin_label.html" %}

      {% if project.classifier != None %}
        {% include "projects/admin/admin_model.html" %}
      {% endif %}

      {% if project.percentage_irr > 0 %}
        {% include "projects/admin/admin_irr.html" %}
      {% endif %}
    </div>
  </div>
</div>
{% endblock %}

{% block scripts_body %}
<script>
window.PROJECT_PK = "{{ project.pk }}"
window.PROJECT_CLASSIFIER = "{{ project.classifier }}"
window.PROJECT_LEARNING_METHOD = "{{ project.learning_method }}"
window.PROJECT_PERCENTAGE_IRR = {{ project.percentage_irr }}
</script>
{% render_bundle 'admins' 'js' %}
{% endblock %}